﻿namespace SingleBlog.Web.Models
{
    /// <summary>
    /// 获取推荐文章的设置
    /// </summary>
    public class RecommandArticleViewModel
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RecommandArticleViewModel"/> class.
        /// </summary>
        public RecommandArticleViewModel()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RecommandArticleViewModel"/> class.
        /// </summary>
        /// <param name="categoryId">The category identifier.</param>
        public RecommandArticleViewModel(int categoryId)
        {
            this.CategoryId = categoryId;
        }

        /// <summary>
        /// 分类Id，null 表示所有的分类
        /// </summary>
        public int? CategoryId { get; set; }

        /// <summary>
        /// 显示标题
        /// </summary>
        public string Title { get; set; } = "相关推荐";
        /// <summary>
        /// 空数据时显示的文本
        /// </summary>
        public string EmptyDataText { get; set; } = "暂无任何数据";

        /// <summary>
        /// 截断文章标题字数设置。标题字数超过设置的长度，则显示“...”
        /// </summary>
        public int ArticleTitleCut { get; set; } = 28;

        /// <summary>
        /// 是否使用新窗口打开超链接
        /// </summary>
        public bool NewWindow { get; set; }

        /// <summary>
        /// 获取或设置一个布尔值，如果没数据时，是否使用 <see cref="EmptyDataText"/> 的文字表示
        /// </summary>
        public bool ShowEmptyDataTextIfNoData { get; set; } = true;
    }
}
